Skip to content

feat: Generate REC/2023/03 liquid chromatography tabular schema models#1188

Merged
nathan-stender merged 3 commits into
mainfrom
feat/lc-rec-2023-03-schema
Apr 21, 2026
Merged

feat: Generate REC/2023/03 liquid chromatography tabular schema models#1188
nathan-stender merged 3 commits into
mainfrom
feat/lc-rec-2023-03-schema

Conversation

@nathan-stender

Copy link
Copy Markdown
Collaborator

Summary

  • Adds support for flat tabular schemas (root properties without allOf) in the codegen pipeline
  • Generates the LC REC/2023/03 model, which uses this older flat format — previously produced empty output
  • Stabilizes unit dedup ordering in units.py and quantity_values.py so adding older schema dependencies doesn't change existing unit strings

Changes

  • generator.py: Broaden _is_adm_schema to detect flat schemas with nested object properties; merge root-level properties in _generate_adm_module before allOf processing
  • generate.py: Add secondary sort key for deterministic unit class name assignment; read existing quantity_values.py to preserve committed unit strings when older schemas introduce alternate spellings
  • New files: Cached JSON schemas (core REC/2021/12, core REC/2022/12, qudt REC/2021/12, qudt REC/2023/03, LC REC/2023/03) and generated models

Test plan

  • hatch run test_all.py3.10:pytest tests/ -x -q — all 1112 tests pass
  • hatch run lint — clean (ruff, black, mypy)
  • hatch run scripts:generate-schemas --all produces no changes to existing committed models
  • test_generated_models_are_up_to_date passes (regeneration in tmp dir matches committed)
  • test_single_technique_smoke passes for all cached schemas

🤖 Generated with Claude Code

Support flat tabular schemas (root properties without allOf) in the codegen
pipeline. The LC REC/2023/03 schema uses this older format, which previously
produced empty output.

Changes:
- Broaden _is_adm_schema to detect flat schemas with nested object properties
- Merge root-level properties in _generate_adm_module before allOf processing
- Stabilize unit dedup ordering in units.py with secondary sort on const value
- Preserve existing quantity_values.py unit strings when older schemas introduce
  alternate spellings of the same unit

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nathan-stender
nathan-stender requested review from a team and slopez-b as code owners April 21, 2026 17:16
nathan-stender and others added 2 commits April 21, 2026 13:34
…ic sort

Same pattern as the units.py fix — sort by (class_name, unit_str) before
deduplicating so the alphabetically-first unit string always wins. Removes
_read_existing_quantity_value_classes and _QV_CLASS_RE entirely. Generation
is now a pure function of schemas with no dependency on committed file state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nathan-stender
nathan-stender merged commit 80e7bf1 into main Apr 21, 2026
9 checks passed
@nathan-stender
nathan-stender deleted the feat/lc-rec-2023-03-schema branch April 21, 2026 17:42
nathan-stender added a commit that referenced this pull request Apr 21, 2026
### Added

- Generate REC/2023/03 liquid chromatography tabular schema models
(#1188)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants